//Page Object
import { request } from '../../request/index'
let app = getApp();
Page({
  data: {
    //存放数据
    swiperList:[],
    //导航数组
    catesList:[],
    //楼层数据
    floorList:[]
  },
  //options(Object)
  onLoad: function(options){
    console.log(app.globalData.height);
    this.getSwiperList();
    this.getCatesList();
    this.getFloorList();
  },
  //获取轮播图数据
  getSwiperList() {
    request({url:"/home/swiperdata"})
    .then(result => {
      this.setData({
        swiperList:result.data.message
      })
    })
  },
  //获取分类导航数据
  getCatesList() {
    request({url:"/home/catitems"})
    .then(result => {
      // console.log(result);
      this.setData({
        catesList:result.data.message
      })
    })
  },
  //获取楼层数据
  getFloorList() {
    request({url:"/home/floordata"})
      .then(result => {
        console.log(result);
        this.setData({
          floorList:result.data.message
        })
      })
  }
});